Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

105
Vistas
How to go to a dynamic route using nuxt "to" directive

This works:

<tr
   v-for="item in favourites.slice(0, 5)"
   :key="item.id"
   @click="$router.push('/items/' + item.id)"
>

But I want to write something like this because I think it looks cleaner:

<tr
   v-for="item in favourites.slice(0, 5)"
   :key="item.id"
   nuxt
   :to="`/items/${item.id}`"
>

I think it doesn't work because Nuxt just looks for "to" and doesn't understand the ":" modifier. Is there any way to achieve dynamic values in the "to" tag or do I just have to stick to first example, which is working?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use NuxtLink.

<NuxtLink
   v-for="item in favourites.slice(0, 5)"
   :key="item.id"
   tag="tr"
   :to="`/items/${item.id}`"
>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda